Stroustrup begins his answer to the his FAQ on How do I deal with memory leaks? by saying:
Well and good. At the same time, I have heard the argument that since (most of the common) operating systems reclaim memory used by a program when it quits, it is not necessary to use delete/delete[] on objects created with new/new[] that last till the end of the program, unless their destruction does something that the operating system will not do.By writing code that doesn't have any. Clearly, if your code has new operations, delete operations, and pointer arithmetic all over the place, you are going to mess up somewhere and get leaks, stray pointers, etc. This is true independently of how conscientious you are with your allocations: eventually the complexity of the code will overcome the time and effort you can afford. It follows that successful techniques rely on hiding allocation and deallocation inside more manageable types. Good examples are the standard containers. They manage memory for their elements better than you could without disproportionate effort.
After reading through several examples in the FLTK documentation, I assumed that either FLTK handled the freeing of memory, or the examples were relying on the operating system to do the job. Some searching brought me to a thread (WTF new -> delete where a user had the same concerns.
The responses basically went over this issue, though some took the position that deletes at program exit were neither necessary nor harmful, others stated that it was not necessary and potentially harmful, and the thread starter insisted that it was necessary.
So, what is your take on this?